Thank you for using our contact form '+decodeURIComponent(name)+'! Your email was successfully sent and we'll be in touch with you soon.
');
}
}
function sendRequest_booking() {
var rnd = Math.random();
var name = escape(document.getElementById("name").value);
var email = escape(document.getElementById("email").value);
var surname = escape(document.getElementById("surname").value);
var arrival = escape(document.getElementById("arrival").value);
var room = escape(document.getElementById("room").value);
var departure = escape(document.getElementById("departure").value);
var children = escape(document.getElementById("children").value);
var adults = escape(document.getElementById("adults").value);
var rooms = escape(document.getElementById("rooms").value);
var body = document.getElementById("body").value;
try{
http.open('POST', 'php/bookingform.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse;
http.send('name='+name+'&surname='+surname+'&email='+email+'&arrival='+arrival+'&room='+room+'&departure='+departure+'&children='+children+'&adults='+adults+'&rooms='+rooms+'&body='+body+'&rnd='+rnd);
}
catch(e){}
finally{
jQuery('#contactform_booking').slideUp("slow").hide();
jQuery('#contactWrapper').append('
Email Successfully Sent!
Thank you for using our contact form '+decodeURIComponent(name)+'! Your email was successfully sent and we'll be in touch with you soon.
');
}
}
function sendRequest_loans() {
var rnd = Math.random();
var name = escape(document.getElementById("name").value);
var name_s = escape(document.getElementById("name_s").value);
var subject = escape(document.getElementById("subject").value);
try{
http.open('POST', 'php/contactform_loans.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse_popup;
http.send('name='+name+'&name_s='+name_s+'&subject='+subject+'&rnd='+rnd);
}
catch(e){}
finally{
jQuery('#contactform_popup').slideUp("slow").hide();
jQuery('#contactWrapper_popup').append('
Email Successfully Sent!
Thank you for using our contact form '+name+'! Your email was successfully sent and we'll be in touch with you soon.
');
}
}
function sendRequest_popup() {
var rnd = Math.random();
var name = escape(document.getElementById("name_popup").value);
var email = escape(document.getElementById("email_popup").value);
var phone = escape(document.getElementById("phone_popup").value);
// var subject = escape(document.getElementById("subject_popup").value);
// var body = escape(document.getElementById("body_popup").value);
// var from_popup = escape(document.getElementById("from_popup").value);
// var to_popup = escape(document.getElementById("to_popup").value);
// var move_popup = escape(document.getElementById("move_popup").value);
try{
http.open('POST', '/contactform.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse_popup;
http.send('name='+name+'&email='+email+'&phone='+phone);
}
catch(e){}
finally{
jQuery('#contactform_popup').slideUp("slow").hide();
jQuery('#contactWrapper_popup').html('
We have received your request!
We will be contacting you to assist with your funding.
');
}
}
function sendRequest_news() {
var rnd = Math.random();
if(document.getElementById("name_news") instanceof Object){
var name = escape(document.getElementById("name_news").value);}
else{
var name ='noname';
}
var email = escape(document.getElementById("email_news").value);
try{
http.open('POST', 'php/newsletter.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse_news;
http.send('name_news='+name+'&email_news='+email+'&rnd_news='+rnd);
}
catch(e){
}
finally{
jQuery('#newsletterform').slideUp("slow").hide();
jQuery('#newsletterform').parent().append('
Subscription Successfully Sent!
Your email: '+email+' has been registered.
');
}
}
function sendRequest_news_simple() {
var rnd = Math.random();
var email = escape(document.getElementById("email_news").value);
try{
http.open('POST', 'php/newsletter.php');
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = handleResponse_news;
http.send('email_news='+email+'&rnd_news='+rnd);
}
catch(e){
}
finally{
jQuery('#newsletterform').slideUp("slow").hide();
jQuery('#newsletterform').parent().append('
Subscription Successfully Sent!
Your email: '+email+' has been registered.
');
}
}
function validate_email(address) {
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
if(reg.test(address) == false) {
return false;
}
else
return true;
}
function validate_phone(phone){
var reg = /^[\:\-\.\_\(\) 0-9]+$/
if(reg.test(phone) == false) {
return false;
}
else
return true;
}
function check_values() {
//Form
var valid = '';
var $j = jQuery.noConflict();
var name = '';
var email = '';
var subject = '';
var body = '';
if(typeof $j('#contactform #name').val() != "undefined" )
{
name = document.getElementById("name").value;
}
if(typeof $j('#contactform #email').val() != "undefined" )
{
email = document.getElementById("email").value;
}
if(typeof $j('#contactform #subject').val() != "undefined" )
{
subject = document.getElementById("subject").value;
}
if(typeof $j('#contactform #body').val() != "undefined" )
{
body = document.getElementById("body").value;
}
var errors=0;
if($j('#contactform #name').val()!=undefined)
if($j('#contactform #name').val()=='') {
var hasClass=$j('#contactform #name').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #name').parent().append('');
$j('#contactform #name').focus();
//return false;
errors++;
}
else
$j('#contactform #name').parent().find(".error").remove();
if($j('#contactform #email').val()!=undefined)
if(validate_email($j('#contactform #email').val())==false ) {
var hasClass=$j('#contactform #email').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #email').parent().append('');
$j('#contactform #email').focus();
//return false;
errors++;
}
else
$j('#contactform #email').parent().find(".error").remove();
if($j('#contactform #subject').val()!=undefined)
if($j('#contactform #subject').val()==''){
var hasClass=$j('#contactform #subject').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #subject').parent().append('');
$j('#contactform #subject').focus();
//return false;
errors++;
}
else
$j('#contactform #subject').parent().find(".error").remove();
if($j('#contactform #body').val()!=undefined)
if($j('#contactform #body').val()==''){
var hasClass=$j('#contactform #body').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #body').parent().append('');
$j('#contactform #body').focus();
//return false;
errors++;
}
else
$j('#contactform #body').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit").disabled=true;
document.getElementById("submit").value='Please Wait..';
sendRequest();
}
}
function check_values_loans() {
//Form
var valid = '';
var $j = jQuery.noConflict();
var name = '';
var subject = '';
var name_s = '';
if(typeof $j('#contactform #name').val() != "undefined" )
{
name = document.getElementById("name").value;
}
if(typeof $j('#contactform #subject').val() != "undefined" )
{
subject = document.getElementById("subject").value;
}
if(typeof $j('#contactform #name_s').val() != "undefined" )
{
name_s = document.getElementById("name_s").value;
}
var errors=0;
if($j('#contactform #name').val()!=undefined)
if($j('#contactform #name').val()=='') {
var hasClass=$j('#contactform #name').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #name').parent().append('');
$j('#contactform #name').focus();
//return false;
errors++;
}
else
$j('#contactform #name').parent().find(".error").remove();
if($j('#contactform #subject').val()!=undefined)
if($j('#contactform #subject').val()==''){
var hasClass=$j('#contactform #subject').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #subject').parent().append('');
$j('#contactform #subject').focus();
//return false;
errors++;
}
else
$j('#contactform #subject').parent().find(".error").remove();
if($j('#contactform #name_s').val()!=undefined)
if($j('#contactform #name_s').val()==''){
var hasClass=$j('#contactform #name_s').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform #name_s').parent().append('');
$j('#contactform #name_s').focus();
//return false;
errors++;
}
else
$j('#contactform #name_s').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit").disabled=true;
document.getElementById("submit").value='Please Wait..';
sendRequest_loans();
}
}
function check_values_booking() {
//Form
var valid = '';
var $j = jQuery.noConflict();
var name = '';
var email = '';
var body = '';
var surname = '';
var arrival = '';
var departure = '';
var room = '';
var adults = '';
var children = '';
var rooms = '';
if(typeof $j('#contactform_booking #name').val() != "undefined" )
{
name = document.getElementById("name").value;
}
if(typeof $j('#contactform_booking #email').val() != "undefined" )
{
email = document.getElementById("email").value;
}
if(typeof $j('#contactform_booking #body').val() != "undefined" )
{
body = document.getElementById("body").value;
}
if(typeof $j('#contactform_booking #surname').val() != "undefined" )
{
surname = document.getElementById("surname").value;
}
if(typeof $j('#contactform_booking #arrival').val() != "undefined" )
{
arrival = document.getElementById("arrival").value;
}
if(typeof $j('#contactform_booking #departure').val() != "undefined" )
{
departure = document.getElementById("departure").value;
}
if(typeof $j('#contactform_booking #room').val() != "undefined" )
{
room = document.getElementById("room").value;
}
if(typeof $j('#contactform_booking #adults').val() != "undefined" )
{
adults = document.getElementById("adults").value;
}
if(typeof $j('#contactform_booking #children').val() != "undefined" )
{
children = document.getElementById("children").value;
}
if(typeof $j('#contactform_booking #rooms').val() != "undefined" )
{
rooms = document.getElementById("rooms").value;
}
var errors=0;
if($j('#contactform_booking #name').val()!=undefined)
if($j('#contactform_booking #name').val()=='') {
var hasClass=$j('#contactform_booking #name').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #name').parent().append('');
$j('#contactform_booking #name').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #name').parent().find(".error").remove();
if($j('#contactform_booking #email').val()!=undefined)
if(validate_email($j('#contactform_booking #email').val())==false ) {
var hasClass=$j('#contactform_booking #email').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #email').parent().append('');
$j('#contactform_booking #email').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #email').parent().find(".error").remove();
if($j('#contactform_booking #surname').val()=='') {
var hasClass=$j('#contactform_booking #surname').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #surname').parent().append('');
$j('#contactform_booking #surname').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #surname').parent().find(".error").remove();
if($j('#contactform_booking #arrival').val()=='') {
var hasClass=$j('#contactform_booking #arrival').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #arrival').parent().append('');
$j('#contactform_booking #arrival').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #arrival').parent().find(".error").remove();
if($j('#contactform_booking #departure').val()=='') {
var hasClass=$j('#contactform_booking #departure').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #departure').parent().append('');
$j('#contactform_booking #departure').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #departure').parent().find(".error").remove();
if($j('#contactform_booking #room').val()=='') {
var hasClass=$j('#contactform_booking #room').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #room').parent().append('');
$j('#contactform_booking #room').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #room').parent().find(".error").remove();
if($j('#contactform_booking #adults').val()=='') {
var hasClass=$j('#contactform_booking #adults').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #adults').parent().append('');
$j('#contactform_booking #adults').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #adults').parent().find(".error").remove();
if($j('#contactform_booking #children').val()=='') {
var hasClass=$j('#contactform_booking #children').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #children').parent().append('');
$j('#contactform_booking #children').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #children').parent().find(".error").remove();
if($j('#contactform_booking #rooms').val()=='') {
var hasClass=$j('#contactform_booking #rooms').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #rooms').parent().append('');
$j('#contactform_booking #rooms').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #rooms').parent().find(".error").remove();
if($j('#contactform_booking #body').val()!=undefined)
if($j('#contactform_booking #body').val()==''){
var hasClass=$j('#contactform_booking #body').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_booking #body').parent().append('');
$j('#contactform_booking #body').focus();
//return false;
errors++;
}
else
$j('#contactform_booking #body').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit").disabled=true;
document.getElementById("submit").value='Please Wait..';
sendRequest_booking();
}
}
function check_values_popup() {
//Form
var valid = '';
var $j = jQuery.noConflict();
var name = document.getElementById("name_popup").value;
var email = document.getElementById("email_popup").value;
var phone = document.getElementById("phone_popup").value;
// var subject = document.getElementById("subject_popup").value;
// var body = document.getElementById("body_popup").value;
var errors=0;
if($j('#contactform_popup #name_popup').val()!=undefined)
if($j('#contactform_popup #name_popup').val()=='') {
var hasClass=$j('#contactform_popup #name_popup').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_popup #name_popup').parent().append('');
$j('#contactform_popup #name_popup').focus();
//return false;
errors++;
}
else
$j('#contactform_popup #name_popup').parent().find(".error").remove();
if($j('#contactform_popup #email_popup').val()!=undefined)
if(validate_email($j('#contactform_popup #email_popup').val())==false ) {
var hasClass=$j('#contactform_popup #email_popup').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_popup #email_popup').parent().append('');
$j('#contactform_popup #email_popup').focus();
//return false;
errors++;
}
else
$j('#contactform_popup #email_popup').parent().find(".error").remove();
if($j('#contactform_popup #phone_popup').val()!=undefined)
if($j('#contactform_popup #phone_popup').val()=='') {
var hasClass=$j('#contactform_popup #phone_popup').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_popup #phone_popup').parent().append('');
$j('#contactform_popup #phone_popup').focus();
//return false;
errors++;
}
else
$j('#contactform_popup #email_popup').parent().find(".error").remove();
if($j('#contactform_popup #subject').val()!=undefined)
if($j('#contactform_popup #subject_popup').val()==''){
var hasClass=$j('#contactform_popup #subject_popup').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_popup #subject_popup').parent().append('');
$j('#contactform_popup #subject_popup').focus();
//return false;
errors++;
}
else
$j('#contactform_popup #subject_popup').parent().find(".error").remove();
if($j('#contactform_popup #body_popup').val()!=undefined)
if($j('#contactform_popup #body_popup').val()==''){
var hasClass=$j('#contactform_popup #body_popup').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#contactform_popup #body_popup').parent().append('');
$j('#contactform_popup #body_popup').focus();
//return false;
errors++;
}
else
$j('#contactform_popup #body_popup').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit_popup").disabled=true;
document.getElementById("submit_popup").value='Please Wait..';
sendRequest_popup();
}
}
function check_values_news() {
//Form
var valid = '';
var $j = jQuery.noConflict();
var name = '';
var email = '';
if(typeof $j('#newsletterform #name_news').val() != "undefined" )
{
name = document.getElementById("name_news").value;
}
if(typeof $j('#newsletterform #email_news').val() != "undefined" )
{
email = document.getElementById("email_news").value;
}
var errors=0;
if($j('#newsletterform #name_news').val()!=undefined)
if($j('#newsletterform #name_news').val()=='') {
var hasClass=$j('#newsletterform #name_news').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#newsletterform #name_news').parent().append('');
$j('#newsletterform #name_news').focus();
//return false;
errors++;
}
else
$j('#newsletterform #name_news').parent().find(".error").remove();
if($j('#newsletterform #email_news').val()!=undefined)
if(validate_email($j('#newsletterform #email_news').val())==false ) {
var hasClass=$j('#newsletterform #email_news').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#newsletterform #email_news').parent().append('');
$j('#newsletterform #email_news').focus();
//return false;
errors++;
}
else
$j('#newsletterform #email_news').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit").disabled=true;
document.getElementById("submit").value='Please Wait..';
sendRequest_news();
}
}
function check_values_news_simple() {
console.log("dsa");
//Form
var valid = '';
var $j = jQuery.noConflict();
var email = '';
if(typeof $j('#newsletterform #email_news').val() != "undefined" )
{
email = document.getElementById("email_news").value;
}
var errors=0;
if($j('#newsletterform #email_news').val()!=undefined)
if(validate_email($j('#newsletterform #email_news').val())==false ) {
var hasClass=$j('#newsletterform #email_news').parent().find(".error").hasClass("error");
if(!hasClass)
$j('#newsletterform #email_news').parent().append('');
$j('#newsletterform #email_news').focus();
return false;
errors++;
}
else
$j('#newsletterform #email_news').parent().find(".error").remove();
if(errors==0) {
document.getElementById("submit").disabled=true;
document.getElementById("submit").value='Please Wait..';
sendRequest_news_simple();
}
}
function handleResponse() {
try{
if((http.readyState == 4)&&(http.status == 200)){
var response = http.responseText;
document.getElementById("confirmation").innerHTML = response;
document.getElementById("confirmation").style.display ="";
}
}
catch(e){}
finally{}
}
function handleResponse_popup() {
try{
if((http.readyState == 4)&&(http.status == 200)){
var response = http.responseText;
document.getElementById("confirmation_popup").innerHTML = response;
document.getElementById("confirmation_popup").style.display ="";
}
}
catch(e){}
finally{}
}
function handleResponse_news() {
try{
if((http.readyState == 4)&&(http.status == 200)){
var response = http.responseText;
document.getElementById("confirmation").innerHTML = response;
document.getElementById("confirmation").style.display ="";
}
}
catch(e){}
finally{}
}
function isUndefined(a) {
return typeof a == 'undefined';
}
function trim(a) {
return a.replace(/^s*(S*(s+S+)*)s*$/, "$1");
}
function isEmail(a) {
return (a.indexOf(".") > 0) && (a.indexOf("@") > 0);
}
(function($) {
"use strict";
var scrollticker; // Scroll Timer | don't need to set this in every scroll
var rtl = $('body').hasClass('rtl');
var simple = $('body').hasClass('style-simple');
var top_bar_top = '61px';
var header_H = 0;
var pretty = false;
var mobile_init_W = 1240;
jQuery('.helper .link.toggle').click(function(e) {
e.preventDefault();
var el = jQuery(this);
var id = el.attr('data-rel');
var parent = el.closest('.helper');
if (el.hasClass('active')) {
el.removeClass('active');
parent.find('.helper_content > .item-' + id).removeClass('active').slideUp(200);
} else {
parent.find('.links > .link.active').removeClass('active');
parent.find('.helper_content > .item.active').slideUp(200)
el.addClass('active');
parent.find('.helper_content > .item-' + id).addClass('active').slideDown(200);
}
setTimeout(function() {
mfn_sidebar();
}, 200);
});
"use strict";
jQuery(window).bind("debouncedresize", function() {
iframesHeight();
// Isotope | Relayout
jQuery('.masonry.isotope').isotope();
jQuery('.masonry.gallery').isotope('layout');
// Zoom Box | Vertical Align
zoomBoxVerticalAlign();
});
function zoomBoxVerticalAlign() {
jQuery('body:not(.style-simple) .zoom_box').each(function() {
var el = jQuery(this);
var elH = el.height();
var desc = el.find('.desc_wrap');
var descH = desc.height();
var padding = (elH - descH) / 2;
desc.css('padding-top', padding + 'px');
});
}
zoomBoxVerticalAlign();
function iframeHeight(item, ratio) {
var itemW = item.width();
var itemH = itemW * ratio;
if (itemH < 147) itemH = 147;
item.height(itemH);
}
function iframesHeight() {
iframeHeight(jQuery(".blog_wrapper .post-photo-wrapper .mfn-jplayer, .blog_wrapper .post-photo-wrapper iframe, .post-related .mfn-jplayer, .post-related iframe, .blog_slider_ul .mfn-jplayer, .blog_slider_ul iframe"), 0.78); // blog - list
iframeHeight(jQuery(".single-post .single-photo-wrapper .mfn-jplayer, .single-post .single-photo-wrapper iframe"), 0.4); // blog - single
iframeHeight(jQuery(".section-portfolio-header .mfn-jplayer, .section-portfolio-header iframe"), 0.4); // portfolio - single
}
iframesHeight();
var topBarTop = '61px';
var mfn_header_height = 0;
// header height
function mfn_stickyH() {
if (jQuery('body').hasClass('header-below')) {
// header below slider
mfn_header_height = jQuery('.mfn-main-slider').innerHeight() + jQuery('#Header').innerHeight();
} else {
// default
mfn_header_height = jQuery('#Top_bar').innerHeight() + jQuery('#Action_bar').innerHeight();
}
}
// init
function mfn_sticky() {
if (jQuery('body').hasClass('sticky-header')) {
var start_y = mfn_header_height;
var window_y = jQuery(window).scrollTop();
if (window_y > start_y) {
if (!(jQuery('#Top_bar').hasClass('is-sticky'))) {
jQuery('.header-classic .header_placeholder').css('height', jQuery('#Top_bar').innerHeight() - jQuery('#Action_bar').innerHeight());
jQuery('.header-stack .header_placeholder').css('height', 71);
jQuery('.header-below .header_placeholder').css('height', jQuery('#Top_bar').innerHeight());
jQuery('.minimalist-header .header_placeholder').css('height', jQuery('#Top_bar').innerHeight());
jQuery('#Top_bar').addClass('is-sticky').css('top', -60).animate({
'top': jQuery('#wpadminbar').innerHeight()
}, 300);
}
} else {
if (jQuery('#Top_bar').hasClass('is-sticky')) {
jQuery('.header_placeholder').css('height', 0);
jQuery('#Top_bar').removeClass('is-sticky').css('top', topBarTop);
}
}
}
}
function mfn_sidebar() {
if (jQuery('.with_aside .four.columns').length) {
var maxH = jQuery('#Content .sections_group').height() - 20
jQuery('.with_aside .four.columns .widget-area').each(function() {
jQuery(this).css('min-height', 0);
if (jQuery(this).height() > maxH) {
maxH = jQuery(this).height();
}
});
jQuery('.with_aside .four.columns .widget-area').css('min-height', maxH + 'px');
}
}
function mfn_equalH_wrap() {
jQuery('.section.equal-height-wrap .section_wrapper').each(function() {
var maxH = 0;
jQuery('> .wrap', jQuery(this)).each(function() {
jQuery(this).css('height', 'auto');
if (jQuery(this).innerHeight() > maxH) {
maxH = jQuery(this).innerHeight();
}
});
jQuery('> .wrap', jQuery(this)).css('height', maxH + 'px');
});
}
function mfn_equalH() {
jQuery('.section.equal-height .mcb-wrap-inner').each(function() {
var maxH = 0;
jQuery('> .column', jQuery(this)).each(function() {
jQuery(this).css('height', 'auto');
if (jQuery(this).height() > maxH) {
maxH = jQuery(this).height();
}
});
jQuery('> .column', jQuery(this)).css('height', maxH + 'px');
});
}
jQuery('.overlay-menu-toggle').click(function(e) {
e.preventDefault();
jQuery(this).toggleClass('focus');
jQuery('#Overlay').stop(true, true).fadeToggle(500);
var menuH = jQuery('#Overlay nav').height() / 2;
jQuery('#Overlay nav').css('margin-top', '-' + menuH + 'px');
});
function mfn_footer() {
if (jQuery('.footer-fixed #Footer, .footer-sliding #Footer').length) {
var footerH = jQuery('#Footer').height();
jQuery('#Content').css('margin-bottom', footerH + 'px');
}
}
function mfn_header() {
var rightW = jQuery('.top_bar_right').innerWidth();
var parentW = jQuery('#Top_bar .one').innerWidth() - 10;
var leftW = parentW - rightW;
jQuery('.top_bar_left, .menu > li > ul.mfn-megamenu ').width(leftW);
}
function mfn_sectionH() {
var windowH = jQuery(window).height();
// FIX | next/prev section
var offset = 0;
if( $( '.section.full-screen:not(.hide-desktop)' ).length > 1 ){
offset = 5;
}
$( '.section.full-screen' ).each( function(){
var section = $( this );
var wrapper = $( '.section_wrapper', section );
section
.css( 'padding', 0 )
.css( 'min-height', windowH + offset );
var padding = ( windowH + offset - wrapper.height() ) / 2;
if( padding < 50 ) padding = 50;
wrapper
.css( 'padding-top', padding + 10 ) // 20 = column margin-bottom / 2
.css( 'padding-bottom', padding - 10 );
});
}
function adminBarH(){
var height = 0;
// WP adminbar
if( $( 'body' ).hasClass( 'admin-bar' ) ){
height += $( '#wpadminbar' ).innerHeight();
}
// WC demo store
if( $( 'body' ).hasClass( 'woocommerce-demo-store' ) ){
height += $( 'body > p.demo_store' ).innerHeight();
}
return height;
}
function mfn_introH(){
var windowH = $(window).height() - $('#Header_wrapper').height() - adminBarH();
$('#Intro.full-screen').each(function(){
var el = $(this);
var inner = $( '.intro-inner', el );
el.css( 'padding', 0 ).css( 'min-height', windowH );
var padding = ( windowH - inner.height() ) / 2;
inner.css( 'padding-top', padding ).css( 'padding-bottom', padding );
});
}
function hashNav() {
// # window.location.hash
var hash = window.location.hash;
if (hash && jQuery(hash).length) {
var stickyH = jQuery('.sticky-header #Top_bar').innerHeight();
var tabsHeaderH = jQuery(hash).siblings('.ui-tabs-nav').innerHeight();
jQuery('html, body').animate({
scrollTop: jQuery(hash).offset().top - stickyH - tabsHeaderH
}, 500);
}
}
function onePageActive(){
if( $('body').hasClass('one-page') ){
var stickyH = $('.sticky-header #Top_bar').innerHeight();
var windowT = $(window).scrollTop();
var start = windowT + stickyH + $('#wpadminbar').innerHeight() + 1;
var first = false;
$('div[data-id]').each(function(){
if( $(this).visible( true ) ){
if( !first ){
first = $(this);
} else if( ( $(this).offset().top < start ) && ( $(this).offset().top > first.offset().top ) ) {
first = $(this);
}
}
if( first ){
var newActive = first.attr('data-id');
var active = '[data-hash="'+ newActive +'"]';
if( newActive ){
var menu = $('#menu');
menu.find('li').removeClass('current-menu-item current-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor');
$( active, menu )
.closest('li').addClass('current-menu-item')
.closest('.menu > li').addClass('current-menu-item');
}
}
});
}
}
function niceScrollFix() {
var el = jQuery('body > .nicescroll-rails');
if (el.length) {
if (el.is(":visible")) {
jQuery('body').addClass('nice-scroll');
} else {
jQuery('body').removeClass('nice-scroll');
}
}
}
jQuery(window).load(function(){
mfn_equalH_wrap();
mfn_equalH();
});
jQuery(document).ready(function() {
topBarTop = parseInt(jQuery('#Top_bar').css('top'), 10);
if (topBarTop < 0) topBarTop = 61;
topBarTop = topBarTop + 'px';
mfnSliderContent();
mfnSliderOffer();
mfnSliderOfferThumb();
mfnSliderBlog();
mfnSliderClients();
mfnSliderPortfolio();
mfnSliderShop();
mfnSliderTestimonials();
//mfn_equalH_wrap();
//mfn_equalH();
function retinaLogo(){
if( window.devicePixelRatio > 1 ){
var el = '';
var src = '';
var height = '';
var parent = $( '#Top_bar #logo' );
var parentH = parent.data( 'height' );
var maxH = {
sticky : {
init : 35,
no_padding : 60,
overflow : 110
},
mobile : {
mini : 50,
mini_no_padding : 60
},
mobile_sticky : {
init : 50,
no_padding : 60,
overflow : 80
}
};
$( '#Top_bar #logo img' ).each( function( index ){
el = $( this );
src = el.data( 'retina' );
height = el.height();
// main -----
if( el.hasClass( 'logo-main' ) ){
if( $( 'body' ).hasClass( 'logo-overflow' ) ){
// do nothing
} else if( height > parentH ){
height = parentH;
}
}
// sticky -----
if( el.hasClass( 'logo-sticky' ) ){
if( $( 'body' ).hasClass( 'logo-overflow' ) ){
if( height > maxH.sticky.overflow ){
height = maxH.sticky.overflow;
}
} else if( $( 'body' ).hasClass( 'logo-no-sticky-padding' ) ){
if( height > maxH.sticky.no_padding ){
height = maxH.sticky.no_padding;
}
} else if( height > maxH.sticky.init ){
height = maxH.sticky.init;
}
}
// mobile -----
if( el.hasClass( 'logo-mobile' ) ){
if( $( 'body' ).hasClass( 'mobile-header-mini' ) ){
if( parent.data( 'padding' ) > 0 ){
if( height > maxH.mobile.mini ){
height = maxH.mobile.mini;
}
} else {
if( height > maxH.mobile.mini_no_padding ){
height = maxH.mobile.mini_no_padding;
}
}
}
}
// mobile-sticky -----
if( el.hasClass( 'logo-mobile-sticky' ) ){
if( $( 'body' ).hasClass( 'logo-no-sticky-padding' ) ){
if( height > maxH.mobile_sticky.no_padding ){
height = maxH.mobile_sticky.no_padding;
}
} else if( height > maxH.mobile_sticky.init ){
height = maxH.mobile_sticky.init;
}
}
// SET
if( src ){
el.parent().addClass( 'retina' );
el.attr( 'src', src ).css( 'max-height', height + 'px' );
}
});
}
}
retinaLogo();
jQuery('.responsive-menu-toggle').click(function(e) {
e.preventDefault();
var el = jQuery(this)
var menu = jQuery('#Top_bar #menu');
var menuWrap = menu.closest('.menu_wrapper');
el.toggleClass('active');
if (el.hasClass('is-sticky') && el.hasClass('active')) {
var top = 0;
if (menuWrap.length) top = menuWrap.offset().top;
jQuery('body,html').animate({
scrollTop: top
}, 200);
}
menu.stop(true, true).slideToggle(200);
});
function sideSlide(){
var slide = $( '#Side_slide' );
var overlay = $( '#body_overlay' );
var ss_mobile_init_W = mobile_init_W;
var pos = 'right';
// constructor ----------
var constructor = function(){
if( ! slide.hasClass( 'enabled' ) ){
$( 'nav#menu' ).detach().appendTo( '#Side_slide .menu_wrapper' );
slide.addClass( 'enabled' );
}
};
// destructor ----------
var destructor = function(){
if( slide.hasClass( 'enabled' ) ){
close();
$( 'nav#menu' ).detach().prependTo( '#Top_bar .menu_wrapper' );
slide.removeClass( 'enabled' );
}
};
// reload ----------
var reload = function(){
if( ( $(document).width() < ss_mobile_init_W ) ){
constructor();
} else {
destructor();
}
};
// init ----------
var init = function(){
if( slide.hasClass( 'left' ) ){
pos = 'left';
}
if( $( 'body' ).hasClass( 'header-simple' ) ){
ss_mobile_init_W = 9999;
}
reload();
};
// reset to default ----------
var reset = function( time ){
$( '.lang-active.active', slide ).removeClass('active').children('i').attr('class','icon-down-open-mini');
$( '.lang-wrapper', slide ).fadeOut(0);
$( '.icon.search.active', slide ).removeClass('active');
$( '.search-wrapper', slide ).fadeOut(0);
$( '.menu_wrapper, .social', slide ).fadeIn( time );
};
// menu button ----------
var button = function(){
// show
if( pos == 'left' ){
slide.animate({ 'left':0 },300);
$('body').animate({ 'right':-125 },300);
} else {
slide.animate({ 'right':0 },300);
$('body').animate({ 'left':-125 },300);
}
overlay.fadeIn(300);
// reset
reset(0);
};
// close ----------
var close = function(){
if( pos == 'left' ){
slide.animate({ 'left':-250 },300);
$('body').animate({ 'right':0 },300);
} else {
slide.animate({ 'right':-250 },300);
$('body').animate({ 'left':0 },300);
}
overlay.fadeOut(300);
};
// search ----------
$( '.icon.search', slide ).on( 'click', function(e){
e.preventDefault();
var el = $(this);
if( el.hasClass('active') ){
$( '.search-wrapper', slide ).fadeOut(0);
$( '.menu_wrapper, .social', slide ).fadeIn(300);
} else {
$( '.search-wrapper', slide ).fadeIn(300);
$( '.menu_wrapper, .social', slide ).fadeOut(0);
$( '.lang-active.active', slide ).removeClass('active').children('i').attr('class','icon-down-open-mini');
$( '.lang-wrapper', slide ).fadeOut(0);
}
el.toggleClass('active');
});
// search form submit ----------
$( 'a.submit', slide ).on( 'click', function(e){
e.preventDefault();
$('#side-form').submit();
});
// lang menu ----------
$( '.lang-active', slide ).on( 'click', function(e){
e.preventDefault();
var el = $(this);
if( el.hasClass('active') ){
$( '.lang-wrapper', slide ).fadeOut(0);
$( '.menu_wrapper, .social', slide ).fadeIn(300);
el.children('i').attr('class','icon-down-open-mini');
} else {
$( '.lang-wrapper', slide ).fadeIn(300);
$( '.menu_wrapper, .social', slide ).fadeOut(0);
el.children('i').attr('class','icon-up-open-mini');
$( '.icon.search.active', slide ).removeClass('active');
$( '.search-wrapper', slide ).fadeOut(0);
}
el.toggleClass('active');
});
// init, click, debouncedresize ----------
// init
init();
// click | menu button
$( '.responsive-menu-toggle' ).off( 'click' );
$( '.responsive-menu-toggle' ).on( 'click', function(e){
e.preventDefault();
button();
});
// click | close
overlay.on( 'click', function(e){
close();
});
$( '.close', slide ).on( 'click', function(e){
e.preventDefault();
close();
});
// click | below search or languages menu
$( slide ).on( 'click', function(e){
if( $( e.target ).is( slide ) ){
reset(300);
}
});
// debouncedresize
$( window ).on( 'debouncedresize', reload );
}
if( $( 'body' ).hasClass( 'mobile-side-slide' ) ){
sideSlide();
}
function mainMenu(){
var mm_mobile_init_W = mobile_init_W;
if( $( 'body' ).hasClass( 'header-simple' ) || $( '#Header_creative.dropdown' ).length ){
mm_mobile_init_W = 9999;
}
$( '#menu > ul.menu' ).mfnMenu({
addLast : true,
arrows : true,
mobileInit : mm_mobile_init_W,
});
$( '#secondary-menu > ul.secondary-menu' ).mfnMenu({
mobileInit : mm_mobile_init_W,
});
}
mainMenu();
mfn_stickyH()
mfn_sticky();
function onePageScroll() {
if (!jQuery('body').hasClass('one-page')) {
var menu = jQuery('#menu');
if (menu.find('li.scroll').length > 1) {
menu.find('li.current-menu-item:not(:first)').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor');
// menu item click
menu.find('a').click(function() {
jQuery(this).closest('li').siblings('li').removeClass('current-menu-item currenet-menu-parent current-menu-ancestor current_page_item current_page_parent current_page_ancestor');
jQuery(this).closest('li').addClass('current-menu-item');
});
}
}
}
onePageScroll();
function onePageMenu(){
if( $('body').hasClass('one-page') ){
var menu = $('#menu');
// add attr [data-hash] & [data-id] ----------
$('a[href]', menu).each(function(){
var url = $(this).attr( 'href' );
if( url && url.split('#')[1] ){
// data-hash
var hash = '#' + url.split('#')[1];
if( hash && $(hash).length ){ // check if element with specified ID exists
$(this).attr( 'data-hash', hash );
$(hash).attr( 'data-id', hash );
}
// Visual Composer
var vcHash = '#' + url.split('#')[1];
var vcClass = '.vc_row.' + url.split('#')[1];
if( vcClass && $(vcClass).length ){ // check if element with specified Class exists
$(this).attr( 'data-hash', vcHash );
$(vcClass).attr( 'data-id', vcHash );
}
}
});
// active ----------
var hash;
var activeSelector = '.menu > li.current-menu-item, .menu > li.current-menu-parent, .menu > li.current-menu-ancestor, .menu > li.current-page-ancestor, .menu > li.current_page_item, .menu > li.current_page_parent, .menu > li.current_page_ancestor';
if( $( activeSelector, menu ).length ){
// remove duplicated
$( activeSelector, menu )
.not(':first').removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' );
// remove if 1st link to section & section is not visible
hash = $( activeSelector, menu ).find('a[data-hash]').attr( 'data-hash' );
if( hash ){
hash = '[data-id="'+ hash +'"]';
if( $(hash).length && $( hash ).visible( true ) ){
// do nothing
} else {
$( activeSelector, menu ).removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' )
.closest('.menu > li').removeClass( 'current-menu-item current-menu-parent current-menu-ancestor current-page-ancestor current_page_item current_page_parent current_page_ancestor' );
}
} else {
// do nothing
}
} else {
// add to first if none is active
var first = $( '.menu > li:first-child', menu );
var firstA = first.children('a');
if( firstA.attr( 'data-hash' ) ){
hash = firstA.attr( 'data-hash' );
hash = '[data-id="'+ hash +'"]';
var wpadminbarH = $('#wpadminbar').innerHeight() * 1;
if( $(hash).length && ( $(hash).offset().top == wpadminbarH ) ){
first.addClass( 'current-menu-item' );
}
}
}
// click ----------
$('#menu a[data-hash]').click(function(e){
e.preventDefault(); // only with: body.one-page
// active
menu.find('li').removeClass('current-menu-item');
$(this)
.closest('li').addClass('current-menu-item')
.closest('.menu > li').addClass('current-menu-item');
var hash = $(this).attr('data-hash');
hash = '[data-id="'+ hash +'"]';
// mobile - sticky header - close menu
if( $(window).width() < 768 ){
$('.responsive-menu-toggle').removeClass('active');
$('#Top_bar #menu').hide();
}
// offset
var headerFixedAbH = $('.header-fixed.ab-show #Action_bar').innerHeight();
var tabsHeaderH = $(hash).siblings('.ui-tabs-nav').innerHeight();
var offset = headerFixedAbH - tabsHeaderH - $('#wpadminbar').innerHeight();
// sticky height
var stickyH = fixStickyHeaderH();
// FIX | Header below | 1st section
if( $( 'body' ).hasClass( 'header-below' ) && $( '#Content' ).length ){
if( $( hash ).offset().top < ( $( '#Content' ).offset().top + 60 ) ){
stickyH = -1;
}
}
// animate scroll
$( 'html, body' ).animate({
scrollTop: $( hash ).offset().top - offset - stickyH
}, 500);
});
}
}
onePageMenu();
function fixStickyHeaderH(){
var stickyH = 0;
// FIX | sticky top bar height
var topBar = $('.sticky-header #Top_bar');
if( topBar.hasClass('is-sticky') ){
stickyH = $('.sticky-header #Top_bar').innerHeight();
} else {
topBar.addClass('is-sticky');
stickyH = $('.sticky-header #Top_bar').innerHeight();
topBar.removeClass('is-sticky');
}
// FIX | responsive
var responsive = $('.responsive-menu-toggle');
if( responsive.length ){
if( responsive.is(":visible") ){
stickyH = 0;
}
}
return stickyH;
}
var cHeader = 'body:not(.header-open) #Header_creative';
var cHeaderEl = jQuery(cHeader);
var cHeaderCurrnet;
function creativeHeader() {
jQuery('.creative-menu-toggle').click(function(e) {
e.preventDefault();
cHeaderEl.addClass('active')
if (jQuery('body').hasClass('header-rtl')) {
cHeaderEl.animate({
'right': -1
}, 500);
} else {
cHeaderEl.animate({
'left': -1
}, 500);
}
cHeaderEl.find('.creative-wrapper').fadeIn(500);
cHeaderEl.find('.creative-menu-toggle, .creative-social').fadeOut(500);
});
}
creativeHeader();
jQuery(document).on('mouseenter', cHeader, function() {
cHeaderCurrnet = 1;
})
jQuery(document).on('mouseleave', cHeader, function() {
cHeaderCurrnet = null;
setTimeout(function() {
if (!cHeaderCurrnet) {
cHeaderEl.removeClass('active');
if (jQuery('body').hasClass('header-rtl')) {
cHeaderEl.animate({
'right': -200
}, 500);
} else {
cHeaderEl.animate({
'left': -200
}, 500);
}
cHeaderEl.find('.creative-wrapper').fadeOut(500);
cHeaderEl.find('.creative-menu-toggle, .creative-social').fadeIn(500);
}
}, 1000);
});
jQuery('.downcount').each(function() {
var el = jQuery(this);
el.downCount({
date: el.attr('data-date'),
offset: el.attr('data-offset')
});
});
jQuery('.tooltip-img').hover(function() {
jQuery(this).find('.tooltip-content').stop(true, true).show();
}, function() {
jQuery(this).find('.tooltip-content').stop(true, true).hide();
});
jQuery("#popup_contact > a.button").click(function(e) {
e.preventDefault();
jQuery(this).parent().toggleClass('focus');
});
if (jQuery('body').hasClass('nice-scroll-on') && jQuery(window).width() > 767 && !navigator.userAgent.match(/(Android|iPod|iPhone|iPad|IEMobile|Opera Mini)/)) {
jQuery('html').niceScroll({
autohidemode: false,
cursorborder: 0,
cursorborderradius: 5,
cursorcolor: '#222222',
cursorwidth: 10,
horizrailenabled: false,
mousescrollstep: (window.mfn_nicescroll) ? window.mfn_nicescroll : 40,
scrollspeed: 60
});
jQuery('body').removeClass('nice-scroll-on').addClass('nice-scroll');
niceScrollFix();
}
jQuery('.gallery-icon > a').wrap('